package cate.game.train.equip.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "装备合成 の 请求")
public class EquipForgeReq implements MsgInput {
    @NoteField(value = "id")
    public int id;
    @NoteField(value = "数量")
    public int num;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = game.train.equip.forgeNormalEquip(cc.getRole(), id, num);
        if (!r.ok()) {
            cc.getRole().getGame().notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.EQUIP_FORGE_REQ;
    }
}
